package com.atguigu.test5.test51;

/**
 * @author 路飞
 * @date 2024/4/10 10:43
 * @description 6.	题目描述：统计1~100之间出现了几次数字9
 */
public class Test6 {
    public static void main(String[] args) {
        int count = 0;
        for (int i = 1; i <= 100; i++) {
            if (i % 10 == 9) {
                count++;
                System.out.println("---" + i);
            }
            if (i / 10 == 9) {
                count++;
                System.out.println("***" + i);
            }
        }
        System.out.println("9出现了" + count + "次");
    }
}
